import { request } from "@/utils/service"
import type * as Customs from "./types"

/** 增 */
export function createCustomsApi(data: Customs.CreateOrUpdateCustomsRequestData) {
  return request({
    url: "customs",
    method: "post",
    data
  })
}

/** 删 */
export function deleteCustomsApi(id: string) {
  return request({
    url: `customs/${id}`,
    method: "delete"
  })
}

/** 改 */
export function updateCustomsApi(data: Customs.CreateOrUpdateCustomsRequestData) {
  return request({
    url: "customs/" + data.id,
    method: "put",
    data
  })
}

/** 查 */
export function getCustomsApi(params: Customs.GetCustomsRequestData) {
  return request<Customs.GetCustomsResponseData>({
    url: "customs",
    method: "get",
    params
  })
}

/** 查详情 */
export function getCustomsDetailApi(id: string) {
  return request<Customs.GetNewResponeseDetailData>({
    url: `customs/${id}`,
    method: "get"
  })
}
